|
|
|
|
|
|
|
After building the menu, enter the following code for the Exit menu item: |
|
|
|
|
|
|
|
|
Private Sub mnuFileExit_Click()
cmdExit_Click ' do the exit!
End Sub |
|
|
|
|
|
|
|
|
This code calls the existing routine that handles the program exit. |
|
|
|
|
|
|
|
|
Now you need to add the line of code that calls the new form you are going to create. Enter the following code for the State/Prov menu item: |
|
|
|
|
|
|
|
|
Private Sub mnuListStProv_Click()
frmStProv.Show 1
End Sub |
|
|
|
|
|
|
|
|
This code calls the new form and forces it to display as a modal form. Because it is modal, users cannot change the focus within their project until they safely exit this form. |
|
|
|
|
|
|
|
|
Building the State/Province List Form |
|
|
|
|
|
|
|
|
Now that the housekeeping is done, you can build the new form. Use Table 10.3 and Figure 10.6 as guides as you lay out the new validation form. |
|
|
|
|
| Table 10.3. Controls for the State/Province list form. | | Control | Property | Setting | | VB.Form | Name | frmStProv | | Caption | "State/Province Validation Table" | | ClientHeight | 2220 | | ClientLeft | 60 | | ClientTop | 345 | | ClientWidth | 5895 | | StartUpPosition | 3 'Windows Default | | VB.CommandButton | Name | cmdBtn | | Index | 0 | | VB.TextBox | Name | Text2 | | Height | 255 | | Left | 1440 | | Top | 540 | | Width | 2775 |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|